@import "./xterm.scss";

body,
html {
  min-height: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0px;
  padding: 0px;
  background-color: var(--background-color);
  overflow-x: hidden;
  overflow-y: auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif,
    "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}

.global-text-color {
  color: var(--text-color) !important;
}

.global-bg-color {
  background-color: var(--background-color) !important;
}

.global-layout-card-dragover {
  opacity: 0.5;
  border: 1px solid var(--drag-background-color);
  transform: scale(1.02);
}

.global-placeholder-card-dragover {
  opacity: 0.5;
  border: 1px dashed #5f5f5f;
  transform: scale(1.02);
  border-radius: 6px;
  background-color: var(--drag-background-color);
}

.global-drag-animation {
  transition: all 0.4s ease;
}

.global-card-container-shadow {
  border-radius: 6px;
  box-shadow: 0 1px 2px 1px var(--card-shadow-color);
  transition: box-shadow 0.4s ease-in-out;

  &:hover {
    box-shadow:
      0 4px 8px 0 var(--card-shadow-extend-color),
      0 1px 2px 1px var(--card-shadow-extend-color);
  }
}

.global-action-float-enter-active,
.global-action-float-leave-active {
  transition: all 0.4s ease;
  opacity: 1 !important;
  transform: scale(1);
  position: absolute;
}

.global-action-float-enter-from,
.global-action-float-leave-to {
  opacity: 0 !important;
  transform: scale(0.96);
  position: absolute;
}

.global-app-container {
  max-width: var(--app-max-width);
  margin: auto;
}

@media (max-width: 1410px) {
  .global-app-container {
    margin: 0px 24px;
  }
}

@media (max-width: 992px) {
  .global-app-container {
    margin: 0px 12px;
  }
}

// For markdown
.global-markdown-html {
  img {
    border: 0;
    border-radius: 6px;
    width: 100%;
    box-shadow: 0 1px 2px 1px var(--card-shadow-color);
    height: 100%;
    object-fit: cover;
    aspect-ratio: 16/9;
  }

  ul,
  ol {
    margin-left: 0px;
    padding-left: 16px;
  }

  .app-dark-theme {
    img {
      filter: brightness(0.7);
    }
  }

  blockquote,
  pre {
    background-color: var(--color-gray-3);
    padding: 8px;

    p {
      margin: 0;
    }
  }

  table {
    width: 100%;
    margin-bottom: 10px;
    tbody {
      width: 100%;
    }
    td,
    th {
      text-align: center;
      padding: 8px;
      border: 1px solid var(--color-gray-4);
    }

    th {
      background-color: var(--color-gray-2);
    }
  }
}

// Override the AntDesign original style
.ant-modal-mask,
.ant-drawer-mask {
  backdrop-filter: saturate(110%) blur(4px);
}

.ant-modal {
  margin-top: 16px !important;
  margin-bottom: 16px !important;
}

// Override the AntDesign progress bar animation
.no-animation .ant-progress-bg {
  transition: none !important;
}

// Scrollbar
*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-thumb {
  border-radius: 4px;
  box-shadow: inset 0 0 5px rgba(69, 69, 69, 0.082);
  background: #74717167;
}

*::-webkit-scrollbar-track {
  box-shadow: inset 0 0 5px rgba(49, 49, 49, 0.041);
  border-radius: 4px;
  background: #ffffff0a;
}

.package-card-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: space-between;
  height: 100%;
  transition: all 0.3s ease;
}

.package-image-container {
  overflow: hidden;
  border-radius: 8px;
}

.package-info {
  flex: 1;
}

.package-action {
  display: flex;
  justify-content: center;
}

.download-button {
  margin: 0px auto;
  transition: all 0.3s ease;
  max-width: 140px;
}

.package-image {
  user-select: none;
  position: relative;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  height: 100%;
  width: 100%;
  object-fit: cover;
  height: 160px;
  background-color: var(--color-gray-1);
}

.package-image:hover {
  transform: scale(1.08) rotate(2deg);
  filter: brightness(1.1) contrast(1.1);
}

.package-image:hover::after {
  opacity: 1;
}

.ant-card:hover .download-button {
  transform: scale(1.08);
  box-shadow:
    0 8px 20px rgba(24, 144, 255, 0.4),
    0 0 15px rgba(24, 144, 255, 0.2);
  background: linear-gradient(45deg, #1890ff, #40a9ff);
  border: none;
  animation: pulse-glow 2s infinite;
}

.package-subtitle {
  cursor: pointer;
  background-color: var(--card-bottom-background-color);
  color: rgb(255, 255, 255) !important;
  padding: 8px;
  font-size: 14px !important;
  font-weight: 400 !important;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  text-align: center;
  z-index: 1;
  margin: 0;
}

.package-image-container-summary {
  position: relative;
}

.selected {
  border: 1px solid var(--color-blue-6) !important;
  user-select: none;
  transition: all 0.3s;

  &:hover {
    border: 1px solid var(--color-blue-6);
    box-shadow: inset 0 0 0 0.5px var(--color-blue-6);
  }
}

@keyframes pulse-glow {
  0%,
  100% {
    box-shadow:
      0 8px 20px rgba(24, 144, 255, 0.4),
      0 0 15px rgba(24, 144, 255, 0.2);
  }
  50% {
    box-shadow:
      0 8px 25px rgba(24, 144, 255, 0.6),
      0 0 25px rgba(24, 144, 255, 0.4);
  }
}

.compact-btn-right {
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
}

.compact-btn-left {
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}
